package cn.com.cifi.mars.web.action.sys;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import cn.com.cifi.mars.bean.vo.sys.rsp.IdmUserVo;
import cn.com.cifi.mars.bean.vo.sys.rsp.UserDataPermissionVo;
import cn.com.cifi.mars.bean.vo.sys.rsp.UserFunctionalPermissionVo;
import cn.com.cifi.mars.common.base.BaseAction;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.entity.common.IdmUser;
import cn.com.cifi.mars.service.IdmUserService;

@RestController
public class UserController extends BaseAction implements IUserController{
	
	@Autowired
	private IdmUserService idmUserService;

	/**
	 * 组织机构下的用户信息分页
	 */
	@Override
	public R<IdmUserVo> getUserPageList(String apiVersion, String current, String pageSize, String departmentnumber,String usercn) {
        return ok(idmUserService.queryUserPageList(current,pageSize,departmentnumber,usercn));
	}

	/**
	 * 获取用户的数据权限
	 */
	@Override
	public R<UserDataPermissionVo> getUserDataPermissions(String apiVersion, String userId) {
		return ok(idmUserService.queryUserDataPermissions(userId));
	}

	/**
	 * 获取用户的功能权限
	 */
	@Override
	public R<UserFunctionalPermissionVo> getUserFunctionalPermissions(String apiVersion, String userId) {
		return ok(idmUserService.queryUserFunctionalPermissions(userId));
	}

	@Override
	public R<IdmUser> getPositionGroupUserList(String apiVersion, String positionGroupId, String orgdepid) {
		return ok(idmUserService.getPositionGroupUserList(positionGroupId,orgdepid));
	}


}
